package com.nxn.core.web.tag;

import java.io.Serializable;

import org.apache.commons.lang.Validate;

/**
 * Represents the group element contents.
 * 
 * @author Michael Zhang
 */
public class Group implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3538140216733325860L;
	private Bundles bundles = null;
	private Releases releases = null;

	/**
	 * The class constructor.
	 * 
	 * @param bundles
	 *            The bundled contents, can not be null.
	 * @param releases
	 *            The released contents, can not be null.
	 * 
	 * @throws IllegalArgumentException
	 *             Thrown when the "name" is empty, or the "bundles" or the
	 *             "releases" is null.
	 */
	public Group(Bundles bundles, Releases releases) throws IllegalArgumentException {
		Validate.notNull(bundles, "The 'bundles' is null");
		Validate.notNull(releases, "The 'releases' is null");

		this.bundles = bundles;
		this.releases = releases;
	}

	/**
	 * Returns the bundled contents.
	 * 
	 * @return The Bundles, never be null.
	 */
	public Bundles getBundles() {
		return bundles;
	}

	/**
	 * Returns the released contents.
	 * 
	 * @return The Releases, never be null.
	 */
	public Releases getReleases() {
		return releases;
	}
}
